package com.xiaoming.mojbackendjudgeservice.codesandbox;


import com.xiaoming.mojbackendmodel.model.codesandbox.ExecuteCodeRequest;
import com.xiaoming.mojbackendmodel.model.codesandbox.ExecuteCodeResponse;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 代理类 用来输出log信息
 */
@Slf4j
@AllArgsConstructor
public class CodeSandBoxProxy implements CodeSandBox {
    private  final CodeSandBox codeSandBox;
    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        log.info("代码沙箱请求信息"+executeCodeRequest.toString());
        ExecuteCodeResponse executeCodeResponse=codeSandBox.executeCode(executeCodeRequest);
        log.info("代码沙箱响应信息",executeCodeResponse.toString());
        return executeCodeResponse;
    }
}
